package com.hudson.core.base;

public class StopWatch {
    private long startTime;

    public void start() {
        startTime = System.currentTimeMillis();
    }

    public long stop() {
        return System.currentTimeMillis() - startTime;
    }

    public double stopAndGetSeconds() {
        return (double) System.currentTimeMillis() / 1000.0;
    }

    public double stopAndGetMinutes() {
        return (double) System.currentTimeMillis() / 1000.0 / 60;
    }

    public void reset() {
        start();
    }
}
